function showGoods(pageNum) {
			let box = $('#box')
			box.empty();
			let info = `
				<tr>
					<td>
						序号
					</td>
					<td>
						商品名
					</td>
					<td>
						厂家
					</td>
					<td>
						类型
					</td>
					<td>
						价格
					</td>
					<td>
						库存
					</td>
					<td>
						操作
					</td>
				</tr>
			`;
			$.ajax({
					url: "goodsServlet",
					type: 'get',
					data:{pageNum:pageNum},
					success: function(data) {
						console.log(data)
						for(let t = 0;t<data.data.length;t++){
							info += `
								<tr>
									<td>
										${data.data[t].goodsId }
									</td>
									<td>
										${data.data[t].goodsName }
									</td>
									<td>
										${data.data[t].faName }
									</td>
									<td>
										${data.data[t].type }
									</td>
									<td>
										${data.data[t].prive }
									</td>
									<td>
										${data.data[t].num }
									</td>
									<td>
											<input type="submit" value="删除" onclick=delGoods(${data.data[t].goodsId })>
											<input type="hidden" name="goodsId" value="${data.data[t].goodsId }">
									</td>
								</tr>
							`
						}
						info += `
							<tr>
								<td>页码</td>
						`
						if(data.hasPrev){
							info += `<td>
								<a href="#" onclick="nextPage(${data.pageNum-1})">上一页</a>
							</td>`
						}
						for(let i = 1;i<=data.totalPages;i++){
							info += `
									<td>
										<a href="#" onclick="nextPage(${i})">${i}</a>
									</td>
							`
						}
						if(data.hasNext){
							info += `<td>
								<a href="#" onclick="nextPage(${data.pageNum+1})">下一页</a>
							</td>`
						}
						info += `</tr>`
						box.append(info)
					},
					error: function(xhr, status, error) {
						console.log(error)
					},
					dataType: 'json'
			})
		}
function delGoods(id){
	$.ajax({
		url: "goodsServlet",
		type: 'get',
		data:{goodsId:id},
		success: function(data) {
			showGoods()
		},
		error: function(xhr, status, error) {
			console.log(status)
		}
	})
}
function nextPage(pageNum){
	$.ajax({
		url: "goodsServlet",
		type: 'get',
		data:{pageNum:pageNum},
		success: function(data) {
			showGoods(pageNum)
		},
		error: function(xhr, status, error) {
			console.log(status)
		}
	})
}
$(window).on('load', function() {
	showGoods();
})